﻿using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Text;
using Webapiv3.inetrface;
using Webapiv3.Utils.Log;

namespace Webapiv3.Utils.Filters
{
    public class GlobalExceptionFilter : IExceptionFilter
    {
        public readonly ILog _log;
        public GlobalExceptionFilter(ILog log)
        {
            _log = log;
        }
        public void OnException(ExceptionContext filterContext)
        {
            _log.Error(filterContext.Exception);
        }
    }
}
